import d4dset1
from datetime import datetime, date

sub1 = [196,909,1000,739,1030,425,744,542,892]
sub2 = [279,994,40,124,394,742,908]
sub3 = [292,746,307,344,143,738,821,245,509,839,1231,735,998]

def count_caller_each_day(date_query, sub_ant):
    for i in range(24):
        start_datetime = datetime(date_query.year, date_query.month, date_query.day,
                            i, 0, 0)
        end_datetime = datetime(date_query.year, date_query.month, date_query.day,
                            i, 59, 59)
        distinct_caller_num = d4dset1.count_distinct_caller(sub_ant,
                            start_datetime, end_datetime, 1)
        distinct_caller_num2 = d4dset1.count_distinct_caller(sub_ant,
                            start_datetime, end_datetime, 2)
        print start_datetime, distinct_caller_num, distinct_caller_num2

if __name__ == '__main__':
    for sub in [sub1,sub2,sub3]:
        print sub
        for day in range(7,19):
            count_caller_each_day(date(2011,12,day), sub)


